<?php
require_once 'phpmoko/lib/common.php';

class File
{

	static function getExtension($filename)
	{
		$pos = strrchr($filename, ".");
		if ($pos === false)
			return NULL;

		return substr($pos, 1);
	}

	static function rm($filename)
	{
		if (file_exists($filename))
			unlink($filename);
	}

	/**
	 *
	 * @param string $path
	 * @param bool $recursive
	 * @param int $mode
	 */
	static function mkdir($path, $recursive = false, $mode = 0777)
	{
		if (file_exists($path))
			return;

		if (is_dir($path))
			return;

		mkdir($path, $mode, $recursive);
	}
}
?>